<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%--<x:parse xml="${param.xmlstr}" var="xmlData" />--%>
<div class="t_bar">
	<%--<span class="color_red">*</span>--%>
	项目基本情况
</div>
<c:set var="nature_value">
	<x:out select="$xmlData/data/organizations/organization[@submit_org='1']/nature_value" />
</c:set>
<table class="t_css" id="basic_tab" width="100%" border="0" cellpadding="0" cellspacing="1">
	<col style="width: 25%" />
	<col style="width: 25%" />
	<col style="width: 25%" />
	<col style="width: 25%" />
	<tr class="li_1">
		<td align="right"><span class="color_red">*</span>项目名称：</td>
		<td colspan="3">
			<input type="text" name="proposal/zh_title" id="project_name" style="width: 98%;" class="required" maxlength="100" value="<x:out select="$xmlData/data/proposal/zh_title"/>" label="项目名称">
		</td>
	</tr>
	<tr>
		<td align="right"><span class="color_red">*</span>归口管理部门：</td>
		<%--<td colspan="">
			<c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
			<cpt:tree key="recomend_org_gk" cacheable="false" className="hn_iuput_kuang " readonly="true" value="${recomend_org}"  id="recomend_org" showPattern="all" shieldPattern="0"
					  topCheckbox="false" onClick="initTreeValueExt" />
			<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" class="required" value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理部门">
			<input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
		</td>--%>
		<td>
			<c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
			<cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true" value="${recomend_org}" width=""  label="归口管理部门"
					  id="recomend_org" onlyChooseLeaf="false"  showPattern="all" shieldPattern="0" topCheckbox="true" onClick="initTreeValueExt" />
			<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value"  class="required"  value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理部门">
			<input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
		</td>
		<td align="right"><span class="color_red">*</span>申报日期：</td>
		<td colspan="2">
			<c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
			<cpt:date id="submit_date" name="proposal/submit_date" value="${submit_date}" className=" required date" label="申请日期"></cpt:date>
		</td>

	</tr>
	<tr>
		<td align="right"><span class="color_red">*</span>项目实施地点：</td>
		<td colspan="3">
			<input type="text" name="proposal/build_area" id="build_area" style="width: 98%;" class="required" maxlength="100" value="<x:out select="$xmlData/data/proposal/build_area"/>" label="项目实施地点">
		</td>
	</tr>
    <tr>
        <td align="right"><span class="color_red">*</span>内设学院或机构<br/>（没有可填无）：</td>
        <td colspan="3">
            <input type="text"  name="proposal/built_institute" class="required" onchange="synchronizationAmount1()"  id="built_institute" style="text-align: left;width: 82%;" maxlength="30"
                   value="<x:out select="$xmlData/data/proposal/built_institute"/>" label="内设学院或机构" >
        </td>
    </tr>

	<c:if test="${fn:substring(nature_value,0,1) eq 'A'}">
		<tr>
			<td align="right">企业类型
				（是否中小企业参考工信部联企业〔2011〕300号关于印发中小企业划型标准规定的通知 ）：</td>
			<td colspan="3" >
				<input type="checkbox" name="enterprise_scale" id="isEnterpriseScale" value="中小企业" style="margin-left: 1%" onClick="initControlValue(this.id);removeDisabled();">中小企业
				（<input type="checkbox" name="technology_enterprise" id="technologyEnterprise" disabled="disabled" value="科技型中小企业" onClick="initControlValue(this.id);" >科技型中小企业）
				<input type="checkbox" name="enterprise_scale" id="noEnterpriseScale" value="民营企业" style="margin-left: 25%" onClick="initControlValue(this.id);">民营企业
				<input type="hidden" id="enterprise_scale_value" name="proposal/enterprise_scale_value"    value="<x:out select="$xmlData/data/proposal/enterprise_scale_value" />" label="企业类型">
				<input type="hidden" id="technology_enterprise_value" name="proposal/technology_enterprise_value" value="<x:out select="$xmlData/data/proposal/technology_enterprise_value" />">
			</td>
		</tr>

		<tr>
			<td align="right"><span class="color_red">*</span>是否规模以上工业企业：</td>
			<td colspan="3" align="center">
				<c:set var="industrial_enterprise_value"><x:out select="$xmlData/data/proposal/industrial_enterprise_value" /></c:set>
				<cpt:checkbox key="no_yes" name="industrial_enterprise"  width="70px"  repeatColumn="4" value="${industrial_enterprise_value }"  onClick="industrial_enterprise" tagType="radio" ></cpt:checkbox>
				<input type="hidden" id="industrial_enterprise_value" name="proposal/industrial_enterprise_value" class="required" value="${industrial_enterprise_value}" label="是否规模以上工业企业">
				<input type="hidden" name="proposal/industrial_enterprise_name" value="<x:out select="$xmlData/data/proposal/industrial_enterprise_name" />">
			</td>
		</tr>
		<input type="hidden" name="proposal/industrial_value" id="industrial_value" value="<x:out select="$xmlData/data/proposal/industrial_value" />">
	</c:if>
	<tr>
		<td align="right"><span class="color_red">*</span>是否安徽省十大新兴产业：</td>
		<td colspan="3" align="center">
			<c:set var="emerging_enterprises_value"><x:out select="$xmlData/data/proposal/emerging_enterprises_value" /></c:set>
			<cpt:checkbox key="no_yes" name="emerging_enterprises"  width="100px"  repeatColumn="4" value="${emerging_enterprises_value }"  onClick="emerging_enterprises" tagType="radio" ></cpt:checkbox>
			<input type="hidden" id="emerging_enterprises_value" name="proposal/emerging_enterprises_value" class="required" value="${emerging_enterprises_value}" label="是否安徽省十大新兴产业">
			<input type="hidden" name="proposal/emerging_enterprises_name" value="<x:out select="$xmlData/data/proposal/emerging_enterprises_name" />">

			<div id="emerging_industries_value_div" style="display: none">
				<c:set var="emerging_industries_value"><x:out select="$xmlData/data/proposal/emerging_industries_value" /></c:set>
				<cpt:checkbox key="emerging_industries" name="emerging_industries"  width="100px"  repeatColumn="4" value="${emerging_industries_value }" ></cpt:checkbox>
				<input type="hidden" id="emerging_industries_value" name="proposal/emerging_industries_value" class="required" value="${emerging_industries_value}" label="是否安徽省十大新兴产业-->安徽省十大新兴产业">
				<input type="hidden" name="proposal/emerging_industries_name"  value="<x:out select="$xmlData/data/proposal/emerging_industries_name" />">
			</div>
		</td>
	</tr>

	<tr>
		<td align="right"><span class="color_red">*</span>是否产学研合作项目：</td>
		<td colspan="3" align="center" class="li_2">
			<c:set var="industry_university_value"><x:out select="$xmlData/data/proposal/industry_university_value" /></c:set>
			<cpt:checkbox key="no_yes" name="industry_university"  width="70px"  repeatColumn="4" value="${industry_university_value }"   tagType="radio" ></cpt:checkbox>
			<input type="hidden" id="industry_university_value" name="proposal/industry_university_value" class="required" value="${industry_university_value}" label="是否产学研合作项目">
			<input type="hidden" name="proposal/industry_university_name" value="<x:out select="$xmlData/data/proposal/industry_university_name" />">
		</td>
	</tr>




	<tr>
		<td align="right">项目起止时间：</td>
		<td colspan="3" align="">
			<span name="proposal/start_date">${param.pro_start_date}</span>&nbsp;&nbsp;&nbsp; 至 &nbsp;&nbsp;&nbsp;<span name="proposal/end_date">${param.pro_end_date}</span>
		</td>
	</tr>
    <tr>
        <td align="right">
			<span class="color_red">*</span>专业领域：
        </td>
        <td colspan="3">
            <c:set var="researches">{'id':'<x:out select="$xmlData/data/proposal/researches_value" />','name':'<x:out select="$xmlData/data/proposal/researches_name" />'}</c:set>
            <cpt:tree id="researches" key="medically" value="${researches}" label="专业领域" onClick="initSubjectTreeValueExp" className="input_text" width="60"></cpt:tree>
            <input name="proposal/researches_value" id="researches_code" type="hidden"  label="专业领域" class="required" value="<x:out select="$xmlData/data/proposal/researches_value" />"/>
            <input name="proposal/researches_name" id="researches_name"  type="hidden" value="<x:out select="$xmlData/data/proposal/researches_name" />"/>
        </td>


    </tr>
	<tr>
		<td  align="right"><span class="color_red">*</span>所属技术领域：</td>
			<td  colspan="" align="left" >
				<%-- <input type="hidden" name="proposal/need_approve" value="${need_approve}"> --%>
				<c:set var="applicant_subject_value"><x:out select="$xmlData/data/proposal/applicant_subject_value" /></c:set>
				<c:set var="appl_sub_params">
				       {'grant_code':'<x:out select="$xmlData/data/proposal/sub_grant_code" />','stat_year':'${statYear}'}			 
				</c:set>
				<input name="proposal/applicant_subject_value" type="hidden" value="<x:out select="$xmlData/data/proposal/applicant_subject_value" />" class="required " label="所属技术领域"/>
				<input name="proposal/applicant_subject_name" type="hidden" value="<x:out select="$xmlData/data/proposal/applicant_subject_name" />" />
				<cpt:select style="width: 68%;" id="applicant_subject" key="applicant_subject" className="selectWidth2" onChange="initControlValue('applicant_subject')" value="${applicant_subject_value}" sqlParamVal="${appl_sub_params}"></cpt:select>
		</td>
		<td align="right"><span class="color_red">*</span>项目申请金额（万元）：</td>
		<td>
			<input type="text" name="proposal/request_money1" class="required" id="request_amount" onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;"
				   value="<x:out select="$xmlData/data/proposal/request_money1"/>" label="项目申请金额" onchange="synchronizationAmount();"
			>
		</td>
	</tr>
		
	 <tr>
		<td align="right">项目负责人：</td>
		<td>
			<span name="proposal/fzr_psnname"><x:out
					select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" /></span>
		</td>
		<td align="right">电子邮箱：</td>
		<td>
			<span name="proposal/fzr_email"><x:out
					select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email" /></span>
		</td>
	</tr>	
	<tr>
		<td align="right">手机号码：</td>
		<td>
			<span name="proposal/fzr_mobile"><x:out
					select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" /></span>
		</td>
		<td align="right">联系电话：</td>
		<td>
			<span name="proposal/fzr_tel"><x:out
					select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work" /></span>
		</td>
	</tr>

<tr>
		<td align="right"><span class="color_red">*</span>项目联系人姓名：</td>
		<td>
		     <input  type="text" label="项目联系人姓名" name="proposal/contact_psn_cname" class="input_css required" maxlength="50" value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />">
		</td>
		<input type="hidden" name="proposal/contact_psn_tel" value="<x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_tel"/>"/>
		<input type="hidden" name="proposal/contact_psn_email" value="<x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_email"/>"/>
		<td align="right"><span class="color_red">*</span>联系人手机：</td>
		<td>
		    <input type="text" label="联系人手机" name="proposal/contact_psn_mobile" onfocus="InitInput.setNumber(this,11,0,0);" class="input_css required mobile" maxlength="50" value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />">
		</td>
	</tr>
    <input type="hidden" id="age" name="proposal/attach_age" value="<x:out select="$xmlData/data/proposal/attach_age" />"/>

   <%-- <tr>
		<td align="right">
			<span class="color_red">*</span>项目报审级次：
			<br />
			（省补助资金拨付所属财政局）
		</td>
		<td colspan="3">
			<c:set var="sub_step">{'id':'<x:out select="$xmlData/data/proposal/sub_step_value" />','name':'<x:out select="$xmlData/data/proposal/sub_step_name" />'}</c:set>
			<cpt:tree key="sub_step" cacheable="false" className="hn_iuput_kuang  " readonly="true" value="${sub_step}" label="项目报审级次" id="sub_step" onlyChooseLeaf="false" showPattern="all" shieldPattern="0"
				topCheckbox="true" onClick="initTreeValueExt" />
			<input id="sub_step_value" type="hidden" name="proposal/sub_step_value" class="required" label="项目报审级次" value="<x:out select="$xmlData/data/proposal/sub_step_value" />" />
			<input id="sub_step_name" type="hidden" name="proposal/sub_step_name" value="<x:out select="$xmlData/data/proposal/sub_step_name" />" />


		</td>





    </tr>--%>

</table>
<div class="t_bar">合作单位信息 (最多添加5行)</div>
<table id="inland" border="0" cellspacing="0" cellpadding="0" style="width: 100%" class="table01 t_css">
	<thead>
		<tr >
			<th align="center" width="5%">选择</th>
			<th align="center" width="5%">序号</th>
			<th align="center" width="15%">单位名称</th>
			<th align="center" width="15%">单位地址</th>
			<th align="center" width="10%">合作单位性质</th>
			<th align="center" width="10%">合作形式</th>
			<th align="center" width="10%">合作经费支出（万元）</th>
			<th align="center" width="10%">联系人</th>
			<th align="center" width="10%">电话</th>
			<th align="center" width="10%">是否长三角区域</th>

		</tr>
	</thead>
	<tbody id="inland_tab">
		<tr style="display: none" align="center">
			<td align="center">
				<input type="radio" class="radiobutton" name="selAttendOrg11">
			</td>
			<td align="center">
				<span name="inlands|inland[0]@seq_no">[index]</span>
			</td>
			<td align="center">
				<input name="inlands|inland[0]|org_name" label="单位名称" type="text" required class="input_css required maxlength:300" style="width: 80%;" maxlength="100" value="" />
			</td>

			<td align="center">
				<input name="inlands|inland[0]|org_address" label="单位地址" type="text" required class="input_css required maxlength:300" style="width: 80%;" maxlength="100" value="" />
			</td>

			<td align="center">
				<input name="inlands|inland[0]|coop_org_type" label="合作单位性质" type="text" required class="input_css required " style="width: 80%;" maxlength="100" value="" />
			</td>

			<td align="center">
				<input name="inlands|inland[0]|coop_formal" label="合作形式" type="text" required class="input_css required " style="width: 80%;" maxlength="100" value="" />
			</td>

			<td align="center">
				<input name="inlands|inland[0]|coop_fund_expend" label="合作经费支出" type="text" class="input_css required" style="width: 80%;text-align: right;" maxlength="100" value="" onfocus="InitInput.setNumber(this,9,2,2)"  />
			</td>

			<td align="center">
				<input name="inlands|inland[0]|psn_name" label="联系人" type="text" required class="input_css required " maxlength="100" style="width: 80%;" value="" />
			</td>
			<td align="center">
				<input name="inlands|inland[0]|psn_phone" label="电话" type="text" required class="input_css required " maxlength="18" style="width: 80%;" value="" />
			</td>
			<td align="center">
				<cpt:select id="triangle_region[index]" key="no_yes" name="triangle_region" onChange="initControlValue(this.id);" value="" style="width:85%"></cpt:select>
				<input type="hidden" name="inlands|inland[0]|triangle_region_value" class="required" value=""  label="是否长三角区域" />
				<input type="hidden" name="inlands|inland[0]|triangle_region_name" value=""/>
			</td>


		</tr>
		<c:set value="0" var="index" scope="page" />
		<x:forEach select="$xmlData/data/inlands/inland" var="inland">

			<c:choose>
				<c:when test="${index<10}">
					<c:set value="0" var="flag" scope="page" />
				</c:when>
				<c:otherwise>
					<c:set value="" var="flag" scope="page" />
				</c:otherwise>
			</c:choose>
			<tr align="center">
				<td>
					<input type="radio" class="radiobutton" name="selAttendOrg11">
				</td>
				<td align="center">
					<span name="inlands/inland[${flag}${index}]@seq_no">
						<x:out select="$inland/@seq_no" />
					</span>
				</td>
				<td>
					<input name="inlands/inland[${flag}${index}]/org_name" label="单位名称" type="text" required class="input_css required maxlength:100" style="width: 80%;" maxlength="100"
						value="<x:out select="$inland/org_name" />" />
				</td>

				<td align="center">
					<input name="inlands/inland[${flag}${index}]/org_address" label="单位地址" type="text" required class="input_css required maxlength:300" style="width: 80%;" maxlength="100"
						value="<x:out select="$inland/org_address" />" />
				</td>

				<td align="center">
					<input name="inlands/inland[${flag}${index}]/coop_org_type" label="合作单位性质" type="text" required class="input_css required " style="width: 80%;" maxlength="100"
						value="<x:out select="$inland/coop_org_type" />" />
				</td>

				<td align="center">
					<input name="inlands/inland[${flag}${index}]/coop_formal" label="合作形式" type="text" required class="input_css required " style="width: 80%;" maxlength="100"
						value="<x:out select="$inland/coop_formal" />" />
				</td>

				<td align="center">
					<input name="inlands/inland[${flag}${index}]/coop_fund_expend" label="合作经费支出" type="text" required class="input_css " style="width: 80%;text-align: right;" maxlength="100" onfocus="InitInput.setNumber(this,7,2,2)"
						value="<x:out select="$inland/coop_fund_expend" />" />
				</td>

				<td>
					<input name="inlands/inland[${flag}${index}]/psn_name" label="联系人" type="text" required class="input_css required " style="width: 80%;" maxlength="100"
						value="<x:out select="$inland/psn_name" />" />
				</td>
				<td>
					<input name="inlands/inland[${flag}${index}]/psn_phone" label="电话" type="text" required class="input_css orgCredit required maxlength:18" style="width: 80%;" maxlength="18"
						value="<x:out select="$inland/psn_phone" />" />
				</td>
				<td>
					<c:set var="triangle_region"><x:out select="$inland/triangle_region_value" /></c:set>
					<cpt:select id="triangle_region${flag}${index}" key="no_yes" name="triangle_region" onChange="initControlValue(this.id);" value="${triangle_region }" style="width:85%"></cpt:select>
					<input type="hidden" name="inlands/inland[${flag}${index}]/triangle_region_value" class="required" value="<x:out select="$inland/triangle_region_value" />"  label="是否长三角区域" />
					<input type="hidden" name="inlands/inland[${flag}${index}]/triangle_region_name" value="<x:out select="$inland/triangle_region_name" />"/>
				</td>

			</tr>
			<c:set var="beggerClass"></c:set>
			<c:set value="${index+1}" var="index" scope="page" />
		</x:forEach>
	</tbody>
</table>

<table width="98%" class="not_table">
	<tr>
		<td>
			<input class="button_02" type="button" name="cmdAddbefore" value="添加" onclick="if(checkTabLimit('inland',5,'合作单位信息最多只能填写5条')){addNewRow('inland');change_cs();getLen();}try{top.resizeFrame();}catch(e){};" />
			<input class="button_02" name="cmdMovePrev" type="button" value="上移" onclick="movePrev('inland');change_cs()" />
			<input class="button_02" name="cmdMoveNext" type="button" value="下移" onclick="moveNext('inland');change_cs()" />
			<input class="button_02" name="cmddel" type="button" value="删除" onclick="deleteSelectedRow('inland','合作单位信息');change_cs();getLen();" />
		</td>
	</tr>
</table>
<input type="hidden" id="if_have_org" name="proposal/if_have_org">

<script type="text/javascript">
	$(function(){
		emerging_enterprises();
		$("#tab1").click();
		$("#fragment-tab1 :text,#fragment-tab1 [type='date']").addClass("input_width");
		$("#fragment-tab1 select").addClass("select_width");
		$("table.t_css").each(function(){
			$(this).find("tr").not(".cbTable tr").filter(":even").addClass("li_1");
			$(this).find("tr").not(".cbTable tr").filter(":odd").addClass("li_2");
		});
	});

	$(document).ready (function() {
		compare_age();
		getLen();
		// emerging_enterprises();
	});
	/*function initTreeValueExt(treeId, treeNode) {
		if ((treeNode && treeNode.isParent)) {
			scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
			return false;
		}
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			str = obj.name + "-" + str;
			obj = obj.parentNode;
		}

		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
	}*/

	function initTreeValueExt(treeId, treeNode) {
		if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
			scmWarn($("#" + treeId).attr("label") + messageTip.researchAreaInvalidDisciplineCode);
			if (treeNode.level == 0) {
				$("#" + treeId).val("");
				$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
				$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
				$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
			}

			return false;
		}


		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			obj = obj.parentNode;
		}

		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val(str);
	}

	/**
	*申报人年龄大于57岁，第五个附件为必传
	 * @Author huangxiongwei
	 * @Date 2019/8/23 15:59
	 * @Version V1.0
	 */
	function compare_age() {
		var end_date = ${statYear}+"-01"+"-01";
		var birthday = $("#fzbirthday").val();

		var end_date_year = Number(end_date.substring(0,4));
		var birthday_year = Number(birthday.substring(0,4));

		var end_date_month = Number(end_date.substring(5,7));
		var birthday_month = Number(birthday.substring(5,7));

		var end_date_day = Number(end_date.substring(8));
		var birthday_day = Number(birthday.substring(8));

		var different_value = end_date_year - birthday_year -57;
		var different_value1 = end_date_month - birthday_month;
		var different_value2 = end_date_day - birthday_day;

		if(different_value > 0 || (different_value == 0 && different_value1 > 0 )  || (different_value == 0 && different_value1 == 0  && different_value2 > 0)){
			$("#age").val(1);
		}else {
			$("#age").val(0);
		}
		/*onchangeType2();*/

	}

	function onchangeType2(){
		var age = $("#age").val();
		if(age =='1'){
			$("#prpContent_upload tr").each(function(){
				var attachName = $(this).find("td:eq(1) span[name$='name']").text();
				if(attachName=="申报人超过57周岁，申报单位需出具其能完成项目实施的承诺函（如返聘、延迟退休等）"){
					$(this).find("td:eq(2) span[name$='berif']").text("是");
				}
			});
		}else{
			$("#prpContent_upload tr").each(function(){
				var attachName = $(this).find("td:eq(1) span[name$='name']").text();
				if(attachName=="申报人超过57周岁，申报单位需出具其能完成项目实施的承诺函（如返聘、延迟退休等）"){
					$(this).find("td:eq(2) span[name$='berif']").text("否");
				}

			});
		}

	}

	$(document).ready(function(){
		if($('input:checkbox[name="enterprise_scale"]:checked').val()=="中小企业"){
			$("#technologyEnterprise").removeAttr("disabled");
		}else{
			$("#technologyEnterprise").attr("disabled",true);
		}
	});

	/***
	 * 勾选中小型企业框时打开科技型中小企业选择
	 * 没有勾选时关闭科技型中小企业选择，并清除隐藏域的值
	 *
	 */
	function removeDisabled(){
		if($('input:checkbox[name="enterprise_scale"]:checked').val()=="中小企业"){
			$("#technologyEnterprise").removeAttr("disabled");
		}else{
			$("#technologyEnterprise").removeAttr("checked");
			$("#technology_enterprise_value").val("");
			$("#technologyEnterprise").attr("disabled",true);
		}
	};


	function synchronizationAmount(){
		var request_amount=$("#request_amount").val();
		if(request_amount !=  ""){
			$("#total_each_0").val(parseFloat($("#request_amount").val()).toFixed(2));

			countFundAuto('total_','each_0,each_1,each_2,each_4','investfrom_5');
		}else if(request_amount ==  ""){
			$("#total_each_0").val("");
			countFundAuto('total_','each_0,each_1,each_2,each_4','investfrom_5');
		}

	}

    $(function() {
        $("#inland tr:even").addClass("li_1");
        $("#inland tr:odd").addClass("li_2");
    });


    function change_cs(){
        $("#inland tr:even").removeClass().addClass("li_1");
        $("#inland tr:odd").removeClass().addClass("li_2");
    }

    function initSubjectTreeValueExp(treeId, treeNode) {
       /* if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
           // scmWarn($("#" + treeId).attr("label") + "不能选择第一级，请选择它的子级！");
            if (treeNode.level == null) {
                $("#" + treeId).val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
            }
            return false;
        }*/
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(treeNode.name.substring(treeNode.name.indexOf(".") + 1));
        //触发研究方向
        //checkDisCodeExp(treeNode.id,treeId,true); //下拉树
        //checkDisCodeSelect(treeNode.id,treeId,true);
    }

	/*function fund_compare() {
		var total_each =  (Number($("#total_each_0").val())*100 + Number($("#total_each_1").val())*100 + Number($("#total_each_2").val())*100+ Number($("#total_each_3").val())+ Number($("#total_each_4").val())*100)/100;
		$("#total_investfrom_5").val(total_each);
	}*/
	function synchronizationAmount1(){
		var built_institute=$("#built_institute").val();
		if(built_institute !=  ""){
			$("span[id='built_institute_[00]']").html($("#built_institute").val());
			/*$("#total_fund_18").val(parseFloat($("#request_amount").val()).toFixed(2));*/
		}else if(built_institute ==  ""){
			$("span[id='built_institute_[00]']").html("");
		}
	}

	function getLen() {
		var len=$("#inland tr:gt(1)").length;
		if(len>0){
			$("#if_have_org").val("1");
		}else{
			$("#if_have_org").val("0");
		}
	}

	function emerging_industries() {
		var emerging_industries_value = $("#emerging_industries_value").val();
		if(emerging_industries_value==0){
			$("#emerging_industries").val(1);
		}else if(emerging_industries_value==1){
			$("#emerging_industries").val(0);
		}else {
			$("#emerging_industries").val("");
		}
	}


	function emerging_enterprises() {
		var emerging_enterprises_value = $("#emerging_enterprises_value").val();
		if (emerging_enterprises_value == "0") {
			$("#emerging_industries_value_div").attr("style","display:block");
			$("#emerging_industries_value").addClass("required");
		} else{
			$("#emerging_industries_value_div").attr("style","display:none");
			$("input[name='proposal/emerging_industries_value']").val('');
			$("input[name='proposal/emerging_industries_name']").val('');
			$("#checkbox_dyn_emerging_industries").find("td input[type='checkbox']").attr("checked",false);
			$("#emerging_industries_value").removeClass("required");
		}
	}

</script>
